<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title th:text="${@siteConfig.name}"></title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  <!-- Bootstrap 3.3.6 -->
  <link rel="stylesheet" href="/bootstrap/css/bootstrap.min.css">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="https://lib.baomitu.com/font-awesome/4.5.0/css/font-awesome.min.css">
  <!-- Ionicons -->
  <link rel="stylesheet" href="https://lib.baomitu.com/ionicons/2.0.1/css/ionicons.min.css">
  <!-- Theme style -->
  <link rel="stylesheet" href="/dist/css/AdminLTE.min.css">
  <!-- AdminLTE Skins. Choose a skin from the css/skins
       folder instead of downloading all of them to reduce the load. -->
  <link rel="stylesheet" href="/dist/css/skins/_all-skins.min.css">
  <link rel="stylesheet" href="/plugins/datetimepicker/bootstrap-datetimepicker.min.css">
  <!-- bootstrap validator -->
  <link rel="stylesheet" href="/plugins/bootstrap-validator/css/bootstrapValidator.min.css">
  <!-- fullCalendar 2.2.5-->
  <link rel="stylesheet" href="/plugins/fullcalendar/fullcalendar.min.css">
  <link rel="stylesheet" href="/plugins/fullcalendar/fullcalendar.print.css" media="print">

  <link rel="stylesheet" href="/big/css/big.css">
  <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
  <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  <!--[if lt IE 9]
  <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  [endif]-->
  <!-- jQuery 2.2.3 -->
  <script src="/plugins/jQuery/jquery-2.2.3.min.js"></script>
  <!-- Bootstrap 3.3.6 -->
  <script src="/bootstrap/js/bootstrap.min.js"></script>
  <!-- Slimscroll -->
  <script src="/plugins/slimScroll/jquery.slimscroll.min.js"></script>
  <!-- FastClick -->
  <script src="/plugins/fastclick/fastclick.js"></script>
  <!-- jQuery UI 1.11.4 -->
  <script src="/plugins/jQueryUI/jquery-ui.min.js"></script>
  
  <script src="/plugins/datetimepicker/bootstrap-datetimepicker.min.js"></script>
  <script src="/plugins/datetimepicker/locales/bootstrap-datetimepicker.zh-CN.js"></script>
  
  <script src="/plugins/ckeditor/ckeditor.js"></script>
  <!-- AdminLTE App -->
  <script src="/dist/js/app.min.js"></script>
  <!-- AdminLTE for demo purposes -->
  <script src="/dist/js/demo.js"></script>
  <!-- bootstrap validator -->
  <script src="/plugins/bootstrap-validator/js/bootstrapValidator.min.js"></script>
  <!-- fullCalendar 3.10.1 -->
  <script src="/plugins/moment.2.24.0.min.js"></script>
  <script src="/plugins/fullcalendar/fullcalendar.min.js"></script>
  <script src="/plugins/fullcalendar/demo-to-codepen.js"></script>
  <script src="/plugins/fullcalendar/locale-all.js"></script>
  
  <!-- bigcontainer js -->
  <script src="/big/big.js"></script>
  <script src="/big/meta.js"></script>
  <script src="/big/meta-man.js"></script>
  <script src="/big/leditor.js"></script>
  <script src="/big/workflow.js"></script>
  <script src="/big/notification.js"></script>
  <script src="/big/calendar.js"></script>
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper" th:with="current=${currentMenu ?: bigUser.currentMenu}">

  <header class="main-header">
    <!-- Logo -->
    <a th:href="@{${@siteConfig.home}}" class="logo">
      <!-- mini logo for sidebar mini 50x50 pixels -->
      <span class="logo-mini"><b th:text="${@siteConfig.logomini}"></b></span>
      <!-- logo for regular state and mobile devices -->
      <span class="logo-lg"><b th:text="${@siteConfig.logoname}"></b></span>
    </a>
    <!-- Header Navbar: style can be found in header.less -->
    <nav class="navbar navbar-static-top">
      <!-- Sidebar toggle button-->
      <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </a>

      <div class="navbar-custom-menu">
        <ul class="nav navbar-nav">
          <th:block th:each="top : ${tops ?: bigUser.tops}" th:if="${top.type == '2'}">
          	<th:block th:each="c : ${top.getChildren()}" th:with="a=${c.app}">
	          <th:block th:if="${a == null}">
	            <th:block th:include="${c.url} :: frag(${c})"></th:block>
	          </th:block>
	          <th:block th:unless="${a == null}">
	            <th:block th:replace="|notification/${c.parameters.get('notificationType')}| :: frag(${a})"></th:block>
	          </th:block>
          	</th:block>
          </th:block>
          <!-- User Account: style can be found in dropdown.less -->
          <li class="dropdown user user-menu">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
              <img th:src="@{${bigUser.image2}}" class="user-image" alt="User Image">
              <span class="hidden-xs" th:text="${bigUser.aliasName2}"></span>
            </a>
            <ul class="dropdown-menu">
              <!-- User image -->
              <li class="user-header">
                <img th:src="@{${bigUser.image2}}" class="img-circle" alt="User Image">

                <p>
                  <span th:text="${bigUser.aliasName2}"></span> - <span th:text="${bigUser.rolesName}"></span>
                  <small></small>
                </p>
              </li>
              <!-- Menu Body -->
              <li class="user-body">
                <div class="row">
                  <div class="col-xs-4 text-center">
                    <a href="#">Followers</a>
                  </div>
                  <div class="col-xs-4 text-center">
                    <a href="#">Sales</a>
                  </div>
                  <div class="col-xs-4 text-center">
                    <a href="#">Friends</a>
                  </div>
                </div>
                <!-- /.row -->
              </li>
              <!-- Menu Footer-->
              <li class="user-footer">
                <div class="pull-left">
                  <a class="btn btn-default btn-flat">修改密码</a>
                </div>
                <div class="pull-right">
                  <a href="/logout" class="btn btn-default btn-flat">退出</a>
                </div>
              </li>
            </ul>
          </li>
        </ul>
      </div>
    </nav>
  </header>
  <!-- Left side column. contains the logo and sidebar -->
  <aside class="main-sidebar">
    <!-- sidebar: style can be found in sidebar.less -->
    <section class="sidebar">
      <!-- Sidebar user panel -->
      <div class="user-panel">
        <div class="pull-left image">
          <img th:src="@{${bigUser.image2}}" class="img-circle" alt="User Image">
        </div>
        <div class="pull-left info">
          <p th:text="${bigUser.aliasName2}"></p>
          <a href="#"><i class="fa fa-circle text-success"></i> Online</a>
        </div>
      </div>
      <!-- search form -->
      <form action="#" method="get" class="sidebar-form">
        <div class="input-group">
          <input type="text" name="q" class="form-control" placeholder="Search...">
              <span class="input-group-btn">
                <button type="submit" name="search" id="search-btn" class="btn btn-flat"><i class="fa fa-search"></i>
                </button>
              </span>
        </div>
      </form>
      <!-- /.search form -->
      <!-- sidebar menu: : style can be found in sidebar.less -->
      <ul class="sidebar-menu">
        <li class="header">菜单导航</li>
        <th:block th:each="top : ${tops ?: bigUser.tops}" th:if="${top.type == '1'}">
        <li class="treeview" th:attrappend="class=${' ' + top.getActiveCls()}">
          <a href="javascript:void(0)">
            <i th:class="${top.getIcon2()}"></i>
            <span th:text="${top.name}"></span>
            <span class="pull-right-container">
              <i class="fa fa-angle-left pull-right"></i>
            </span>
          </a>
          <ul class="treeview-menu">
            <th:block th:each="c : ${top.getChildren()}">
            <li th:class="${c.getActiveCls()}">
              <a th:href="@{${root ?: @siteConfig.home}(menu=${c.getNo()},selectedIds=${selectedIds})}"><i th:class="${c.getIcon2()}"></i><span th:text="${' ' + c.name}"></span></a>
            </li>
            </th:block>
          </ul>
        </li>
        </th:block>
      </ul>
    </section>
    <!-- /.sidebar -->
  </aside>

  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper pad" id="divBigContent">
    <div class="nav-tabs-custom">
      <ul class="nav nav-tabs">
        <li class="active">
          <a href="#divBigContentTab_1" data-toggle="tab">
            <span th:text="${current.name}"></span>
          </a>
        </li>
        <!--
        <li class="pull-right">
          <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-folder"></i> <span th:text="${current.parentName}"></span></a></li>
            <li><a th:href="@{/(menu=${current.no})}" th:text="${bigUser.currentMenu.name}"></a></li>
          </ol>
        </li>
        -->
      </ul>
      <div class="tab-content">
        <div class="tab-pane active" id="divBigContentTab_1" th:with="a=${current.app}">
          <th:block th:if="${a == null}">
            <div th:data-menu-url="${url}" data-menu-autoload="true" th:data-menu-id="${current.id}" th:data-menu-parameters="${current.parametersJson}"></div>
          </th:block>
          <th:block th:unless="${a == null}">
              <th:block th:include="meta/app :: frag(${a})"></th:block>
          </th:block>
        </div>
      </div>
      <!-- /.tab-content -->
    </div>
  </div>
  <!-- /.content-wrapper -->
  <footer class="main-footer">
    <div class="pull-right hidden-xs">
      <b>Version</b> 2.3.8
    </div>
    <strong>网站备案号： <a target="_blank" href="https://beian.miit.gov.cn" th:text="${@siteConfig.beian}"></a>.</strong>
  </footer>

  <!-- Add the sidebar's background. This div must be placed
       immediately after the control sidebar -->
</div>
<!-- ./wrapper -->

<th:block th:include="uploadModal"></th:block>
<th:block th:include="modal"></th:block>

<script>
  var contentDiv = $('div[data-menu-autoload=true]');
  var params = BigUtil.parseData(contentDiv, 'data-menu-')
  contentDiv.load (params.url, params);

  // 修改密码
  $('.user-footer a:first').click (function () {
    BigUtil.showMainModal ({
      title : '修改密码',
      html : ['<form>',
        '<div class="form-group">',
        '<input type="password" class="form-control" placeholder="请输入初始密码" name="oldPassword" data-app-required="必填">',
        '</div>',
        '<div class="form-group">',
        '<input type="password" class="form-control" placeholder="请输入新密码" name="newPassword" data-app-required="必填">',
        '</div>',
        '<div class="form-group">',
        '<input type="password" class="form-control" placeholder="请输入再次新密码" name="newPassword2" data-app-required="必填">',
        '</div>',
        '</form>'].join(''),
      fn : function (btn, modal) {
        btn.removeClass('hidden');
        btn.click (function () {
          BigUtil.ajaxForm ({
            form : modal.find('form:first'),
            url : '/password',
            successFn : function (json) {
              modal.modal('hide');
              alert('修改密码成功！');
            }
          });
        });
      }
    });
  });
</script>
</body>
</html>
